package com.kk.base.dao.admin;

import com.kk.base.entity.admin.BuyOff;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@ResponseBody
public interface BuyOffDao extends JpaRepository<BuyOff,Long>, JpaSpecificationExecutor<BuyOff> {

    @Query("select bo from BuyOff bo where bo.id = :id")
    BuyOff find(@Param("id")Long id);

    List<BuyOff> findByBuyOffExpressMailOrder_IdOrderByCreateTime(Long expressMailOrderId);

}
